package com.aliware.tianchi;

import com.aliware.tianchi.loadbalance.ProviderStatus;
import org.apache.dubbo.rpc.listener.CallbackListener;



/**
 * @author daofeng.xjf
 *
 * 客户端监听器
 * 可选接口
 * 用户可以基于获取获取服务端的推送信息，与 CallbackService 搭配使用
 *
 */
public class CallbackListenerImpl implements CallbackListener {


    @Override
    public void receiveServerMsg(String msg) {
        System.out.println("CodingApi receive msg ->" + msg);
        if(msg.contains("#")){
            String values[] =msg.split("#");
            String key = values[0];
            String threads = values[1];
            ProviderStatus.pushMaxThreads(key,threads);
        }

    }


}
